package cn.wk.org.controller;

import cn.wk.basic.controller.FastdfsController;
import cn.wk.basic.utils.AjaxResult;
import cn.wk.org.domain.Shop;
import cn.wk.org.service.IShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/shop")
public class ShopController extends FastdfsController {
    @Autowired
    private IShopService shopService;

    @PostMapping("/settlement")
    public AjaxResult setTlement(@RequestBody Shop shop){
        try{
            shopService.setTlement(shop);
            return new AjaxResult();
        }catch(Exception e){
            e.printStackTrace();
            return new AjaxResult(e.getMessage());
        }
    }

}
